package com.zhcd.sys.controller;



import com.zhcd.sys.pojo.Hospital;
import com.zhcd.sys.service.HospitalService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author feifei
 * @since 2021-12-05
 */
@Controller
@RequestMapping("/Hospital/")
public class HospitalController {

    @Autowired
    private HospitalService goodsService;
    /*
     * @RequestMapping：为当前方法配置访问路径
     * 如果Controllor类上没有配置访问路径，当前项目中所有controller中方法上的访问路径都不能冲突
     */
    @RequestMapping("Index")
    public String Index(Model model) {
        List<Hospital> lists = goodsService.findAll();
        model.addAttribute("list", lists);
        return "/Views/monitor/hospital/hospital_list";
    }
}

